Skip to content

fix(cache): exclude node_modules/.vite-temp from cache input tracking#1096

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix-1095
Mar 26, 2026
Merged

fix(cache): exclude node_modules/.vite-temp from cache input tracking#1096
graphite-app[bot] merged 1 commit intomainfrom
fix-1095

Conversation

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Mar 22, 2026

Summary

  • Bump vite-task to 2663222c which merges synthetic task's input config with parent cache config and supports GlobWithBase with InputBase::Workspace
  • Add !node_modules/.vite-temp/** negative input glob (workspace-root-relative) to Pack and Build subcommands
  • Update test for trailing_var_arg CLI parsing change
  • Add comprehensive snap tests for cache behavior

Vite writes transient compiled config files to node_modules/.vite-temp/ during builds. These files were tracked by fspy as both read and written, causing a read-write overlap that prevented caching ("not cached because it modified its input").

The fix passes !node_modules/.vite-temp/** as a GlobWithBase { base: InputBase::Workspace } negative glob via EnabledCacheConfig.input on Pack and Build subcommands. vite-task PR #296 ensures this glob is resolved relative to the workspace root and merged into the parent task's input config.

vite-task changelog: voidzero-dev/vite-task@69cc6eb...2663222#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed

Snap tests

Test Verifies
command-pack-monorepo cache hit (root + sub dir), source change miss, direct vp pack not cached
vp-build-cache cache hit via vp run, direct vp build not cached
vp-build-cache-monorepo cache hit (root + sub dir), source change miss, direct vp build not cached
vp-pack-cache-disabled cache: false disables caching for vp pack
vp-build-cache-disabled cache: false disables caching for vp build

Test plan

  • cargo check and cargo test pass (with -D warnings)
  • All snap tests pass locally
  • CI passes on all platforms

Closes #1095

🤖 Generated with Claude Code

@netlify
Copy link

netlify bot commented Mar 22, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 5f52b6c
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69c4c2a5e02d2c0008563372

@fengmk2 fengmk2 marked this pull request as draft March 22, 2026 11:31
Copy link
Member Author

fengmk2 commented Mar 23, 2026


How to use the Graphite Merge Queue

Add the label auto-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@fengmk2 fengmk2 force-pushed the fix-1095 branch 2 times, most recently from b7769b9 to b433227 Compare March 25, 2026 03:27
@fengmk2 fengmk2 requested a review from branchseer March 25, 2026 03:32
@fengmk2 fengmk2 self-assigned this Mar 25, 2026
@fengmk2 fengmk2 changed the title fix: cache miss on repeated pack builds fix(cache): exclude node_modules/.vite-temp from cache input tracking Mar 25, 2026
@fengmk2 fengmk2 marked this pull request as ready for review March 25, 2026 03:35
@fengmk2 fengmk2 added the test: e2e Auto run e2e tests label Mar 26, 2026
@graphite-app
Copy link

graphite-app bot commented Mar 26, 2026

Merge activity

…#1096)

## Summary

- Bump vite-task to [2663222c](voidzero-dev/vite-task#296) which merges synthetic task's `input` config with parent cache config and supports `GlobWithBase` with `InputBase::Workspace`
- Add `!node_modules/.vite-temp/**` negative input glob (workspace-root-relative) to Pack and Build subcommands
- Update test for `trailing_var_arg` CLI parsing change
- Add comprehensive snap tests for cache behavior

Vite writes transient compiled config files to `node_modules/.vite-temp/` during builds. These files were tracked by fspy as both read and written, causing a read-write overlap that prevented caching ("not cached because it modified its input").

The fix passes `!node_modules/.vite-temp/**` as a `GlobWithBase { base: InputBase::Workspace }` negative glob via `EnabledCacheConfig.input` on Pack and Build subcommands. vite-task PR [#296](voidzero-dev/vite-task#296) ensures this glob is resolved relative to the workspace root and merged into the parent task's input config.

vite-task changelog: voidzero-dev/vite-task@69cc6eb...2663222#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed

## Snap tests

| Test | Verifies |
| --- | --- |
| `command-pack-monorepo` | cache hit (root + sub dir), source change miss, direct `vp pack` not cached |
| `vp-build-cache` | cache hit via `vp run`, direct `vp build` not cached |
| `vp-build-cache-monorepo` | cache hit (root + sub dir), source change miss, direct `vp build` not cached |
| `vp-pack-cache-disabled` | `cache: false` disables caching for `vp pack` |
| `vp-build-cache-disabled` | `cache: false` disables caching for `vp build` |

## Test plan

- [x] `cargo check` and `cargo test` pass (with `-D warnings`)
- [x] All snap tests pass locally
- [x] CI passes on all platforms

Closes #1095

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app graphite-app bot merged commit 5f52b6c into main Mar 26, 2026
51 checks passed
@graphite-app graphite-app bot deleted the fix-1095 branch March 26, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: e2e Auto run e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cache miss on repeated pack builds: task modifies its own input

2 participants